<%@ include file="../common/top.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<script type="text/javascript">
    //得到图片元素
    function changeCode(){
        var img = document.getElementsByTagName("img")[13];
        img.src = "vCode?time="+new Date().getTime();
    }
</script>

<div id="Catalog">
    <form action="signOn" method="post">
        <p>Please enter your username and password.</p>
        <c:if test="${requestScope.signOnMsg != null}">
            <p> <font color="red">${requestScope.signOnMsg} </font> </p>
        </c:if>
        <table>
            <tr>
                <td>
                <label for="username">Username:</label>
                </td>
                <td>
                <input type="text" name="username" id="username">
                </td>
            </tr>
            <tr>
                <td>
            <label for="password">Password:</label>
                </td>
                <td>
                <input type="password" name="password" id="password">
                </td>
            </tr>
            <tr>
                <td>验证码:</td>
                <td><input id="vCode" name="vCode" type="text" /> </td>

            </tr>
            <tr>
                <td>
                <img id="loginCode" src="vCode">
                </td>
                <td>
                    <a href="javascript:changeCode()">看不清？换一张</a>
                </td>
            </tr>
        </table>
        <input type="submit" value="Login">
    </form>
    Need a user name and password?
    <a href="register">Register Now!</a>

</div>

<%@ include file="../common/bottom.jsp"%>

